{include file="../application/admin/view/health/base.html" /}
<div id="detailInit" class="container-form-box" v-cloak>
    <el-form :model="detailForm" ref="detailForm" :rules="rules" label-width="120px" class="dialog-form">
        <el-form-item label="轮播图名称：" prop="name">
            <el-input v-model="detailForm.name" placeholder="请输入轮播图名称" size="small"></el-input>
        </el-form-item>
        <el-form-item label="轮播图：" prop="image">
            <div class="display-flex">
                <div class="banner-image-box display-flex" v-if="detailForm.image">
                    <div class="upload-images" style="margin-right: 0;">
                        <img class="label-auto" :src="Fast.api.cdnurl(detailForm.image)" style="border-radius: 4px;">
                        <div class="del-image-btn" @click="delImg('image',null)">
                            <img class="label-auto" src="/assets/addons/health/img/goods/close.png">
                        </div>
                    </div>
                </div>
                <div class="add-img display-flex" @click="addImg('image',null,false)" v-if="!detailForm.image">
                    <i class="el-icon-plus"></i>
                </div>
            </div>
        </el-form-item>
        <el-form-item label="跳转方式" prop="type">
            <el-radio-group v-model="detailForm.type">
                <el-radio v-for="(item,index) in typeMap" :key="index" :label="item.name">{{item.label}}</el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="小程序APPID" prop="params.appid" v-if="detailForm.type==1" :rules="[
        { required: true, message: '请输入小程序APPID', trigger: 'blur' }
      ]">
            <el-input v-model="detailForm.params.appid" placeholder="请输入小程序APPID" size="small"></el-input>
        </el-form-item>
        <el-form-item :rules="[
        { required: true, message: '请输入跳转地址', trigger: 'blur' }
      ]" label="跳转地址" prop="params.page" v-if="detailForm.type==1|| detailForm.type==0">
            <el-input type="textarea" autosize v-model="detailForm.params.page" placeholder="请输入跳转地址"
                size="small"></el-input>
        </el-form-item>
        <el-form-item label="状态：" prop="status">
            <div class="display-flex" style="height: 40px;">
                <el-switch v-model="detailForm.status" :active-value="1" :inactive-value="0" active-color="#7438D5"
                    inactive-color="#eee">
                </el-switch>
                <div style="margin-left: 20px;">
                    {{detailForm.status==1?'启用':'禁用'}}
                </div>
            </div>
        </el-form-item>
    </el-form>
    <div class="dialog-footer display-flex">
        <div @click="submitForm(false,'detailForm')" class="dialog-cancel-btn display-flex-c cursor-pointer">取消</div>
        <div @click="submitForm('yes','detailForm')" class="dialog-define-btn display-flex-c cursor-pointer">确定</div>
    </div>
</div>